const { readFileSync } = require("fs")
const { resolve } = require("path")
const { parse } = require("yaml")

function getMetaInfo(p, m, s, fileName) {

    const metaPath = resolve(__dirname, "../../../metas/mockjs/base/meta.yaml")
    const content = readFileSync(metaPath, { encoding: "utf-8" })
    const dataPath = `.config_cached/mill-template-node/mockjs/base/${fileName}.yaml`;
    const dataContent = readFileSync(dataPath, { encoding: "utf-8" })
    // const treeCode = parse(content)
    return {
        title: "造数工具",
        treeCode: content,
        treeData: parse(dataContent)
    }
}

module.exports = {
    getMetaInfo
}